'use client'

export default function GlobalError({
  error,
  reset,
}: {
  error: Error;
  reset: () => void;
}) {
  return (
    <html>
      <body>
        <div className="grid min-h-dvh place-items-center p-6 text-center">
          <div>
            <h1 className="text-xl font-semibold">发生错误</h1>
            <p className="mt-2 text-sm text-foreground/70">{error.message}</p>
            <button
              className="mt-4 rounded bg-foreground px-3 py-2 text-background"
              onClick={() => reset()}
            >
              重试
            </button>
          </div>
        </div>
      </body>
    </html>
  );
}